package com.yuanjin.main;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;

import com.yuanjin.R;
import com.yuanjin.Fragment.Fragment_TulingChating;

public class FragmentContact extends Fragment {
	private Button btn_tuling;
	private Activity activity;
	private LinearLayout ll;

	@Override
	public View onCreateView(LayoutInflater inflater,
			@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		return inflater.inflate(R.layout.fragment_contact, container, false);
	}

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onViewCreated(view, savedInstanceState);
		btn_tuling = (Button) view.findViewById(R.id.tulingchat);

		btn_tuling.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				// Intent intent = new Intent(activity,
				// Fragment_TulingChating2.class);
				// startActivity(intent);
				Intent intent = new Intent(getActivity(),
						Fragment_TulingChating.class);
				startActivity(intent);

				ll = (LinearLayout) getActivity().findViewById(R.id.main_bottom);
				ll.setVisibility(View.GONE);
				Log.e("test", "��������h");
			}
		});
	}

	@Override
	public void onActivityCreated(@Nullable Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onActivityCreated(savedInstanceState);

	}

	@Override
	public void onAttach(Activity activity) {
		// TODO Auto-generated method stub
		super.onAttach(activity);
		this.activity = activity;
	}
}
